package com.hjl.web.servlet;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * 测试
 * @author Lenovo
 * @date 2021/10/8 14:31
 * @version 1.0
 */
@WebServlet("/toSysMain.action")
public class TestServlet extends HttpServlet {
    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        request.setCharacterEncoding("UTF-8");
        String uri=request.getRequestURI();

        String action=uri.substring(uri.lastIndexOf("/")+1,uri.length());

  /*      if("toSysMain.action".equals(action))
        {
            //转发到主页
            request.getRequestDispatcher("jsp/main.jsp").forward(request,response);
        }*/
    }

    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
       doPost(request, response);
    }
}
